<HTML
><HEAD
><TITLE
>GrDrawImageFromFile()</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
"><LINK
REL="HOME"
TITLE="Nano-X Library API"
HREF="index.html"><LINK
REL="UP"
TITLE="Nano-X Function Reference"
HREF="ch2.html"><LINK
REL="PREVIOUS"
TITLE="GrDrawImageBits()"
HREF="nxapi_GrDrawImageBits.html"><LINK
REL="NEXT"
TITLE="GrDrawImageToFit()"
HREF="nxapi_GrDrawImageToFit.html"></HEAD
><BODY
CLASS="REFENTRY"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Nano-X Library API</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="nxapi_GrDrawImageBits.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="nxapi_GrDrawImageToFit.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="NXAPI.GRDRAWIMAGEFROMFILE"
><TT
CLASS="FUNCTION"
>GrDrawImageFromFile()</TT
></A
></H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN2132"
></A
><H2
>Name</H2
><TT
CLASS="FUNCTION"
>GrDrawImageFromFile()</TT
>&nbsp;--&nbsp;Draw an image from a file</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN2136"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN2137"
></A
><P
></P
><P
><CODE
><CODE
CLASS="FUNCDEF"
>  void               <B
CLASS="FSFUNC"
>  GrDrawImageFromFile   </B
></CODE
>( GR_DRAW_ID         <VAR
CLASS="PDPARAM"
> id                    </VAR
>,  GR_GC_ID           <VAR
CLASS="PDPARAM"
> gc                    </VAR
>,  GR_COORD           <VAR
CLASS="PDPARAM"
> x                     </VAR
>,  GR_COORD           <VAR
CLASS="PDPARAM"
> y                     </VAR
>,  GR_SIZE            <VAR
CLASS="PDPARAM"
> width                 </VAR
>,  GR_SIZE            <VAR
CLASS="PDPARAM"
> height                </VAR
>,  char *             <VAR
CLASS="PDPARAM"
> path                  </VAR
>,  int                <VAR
CLASS="PDPARAM"
> flags                 </VAR
>);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2157"
></A
><H2
>Description</H2
><P
>    This function loads the image file specified by
    <TT
CLASS="PARAMETER"
><I
>path</I
></TT
> and draws the image at the specified
    location on the drawable. Supported image types include GIF,
    JPEG, Windows BMP, PNG, XPM and both ASCII and binary variants
    of PBM, PGM and PPM.
    </P
><DIV
CLASS="NOTE"
><P
></P
><TABLE
CLASS="NOTE"
WIDTH="100%"
BORDER="0"
><TR
><TD
WIDTH="25"
ALIGN="CENTER"
VALIGN="TOP"
><IMG
SRC="./stylesheet-images/note.gif"
HSPACE="5"
ALT="Note"></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>    The actual image types supported by the Nano-X server depend on
    the image types that were compiled in at microwindows/nano-X
    library build time.
    </P
></TD
></TR
></TABLE
></DIV
><DIV
CLASS="NOTE"
><P
></P
><TABLE
CLASS="NOTE"
WIDTH="100%"
BORDER="0"
><TR
><TD
WIDTH="25"
ALIGN="CENTER"
VALIGN="TOP"
><IMG
SRC="./stylesheet-images/note.gif"
HSPACE="5"
ALT="Note"></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>    Filename extensions are irrelevant. The algorithm examines the
    magic numbers in the file's header to determine the image type.
    </P
></TD
></TR
></TABLE
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2165"
></A
><H2
>Parameters</H2
><DIV
CLASS="INFORMALTABLE"
><A
NAME="AEN2167"
></A
><P
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><THEAD
><TR
><TH
WIDTH="25%"
ALIGN="LEFT"
VALIGN="TOP"
>Type</TH
><TH
WIDTH="25%"
ALIGN="LEFT"
VALIGN="TOP"
>Name</TH
><TH
WIDTH="50%"
ALIGN="LEFT"
VALIGN="TOP"
>Description</TH
></TR
></THEAD
><TBODY
><TR
><TD
WIDTH="25%"
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="nxstruct_GR_DRAW_ID.html"
><SPAN
CLASS="TYPE"
>GR_DRAW_ID</SPAN
></A
></TD
><TD
WIDTH="25%"
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>id</I
></TT
></TD
><TD
WIDTH="50%"
ALIGN="LEFT"
VALIGN="TOP"
>The ID of the drawable to draw the image onto. </TD
></TR
><TR
><TD
WIDTH="25%"
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="nxstruct_GR_GC_ID.html"
><SPAN
CLASS="TYPE"
>GR_GC_ID</SPAN
></A
></TD
><TD
WIDTH="25%"
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>gc</I
></TT
></TD
><TD
WIDTH="50%"
ALIGN="LEFT"
VALIGN="TOP"
>The ID of the graphics context to use when drawing
        the image. </TD
></TR
><TR
><TD
WIDTH="25%"
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="nxstruct_GR_COORD.html"
><SPAN
CLASS="TYPE"
>GR_COORD</SPAN
></A
></TD
><TD
WIDTH="25%"
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>x</I
></TT
></TD
><TD
WIDTH="50%"
ALIGN="LEFT"
VALIGN="TOP"
>The X coordinate to draw the image at. </TD
></TR
><TR
><TD
WIDTH="25%"
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="nxstruct_GR_COORD.html"
><SPAN
CLASS="TYPE"
>GR_COORD</SPAN
></A
></TD
><TD
WIDTH="25%"
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>y</I
></TT
></TD
><TD
WIDTH="50%"
ALIGN="LEFT"
VALIGN="TOP"
>The Y coordinate to draw the image at. </TD
></TR
><TR
><TD
WIDTH="25%"
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="nxstruct_GR_SIZE.html"
><SPAN
CLASS="TYPE"
>GR_SIZE</SPAN
></A
></TD
><TD
WIDTH="25%"
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>width</I
></TT
></TD
><TD
WIDTH="50%"
ALIGN="LEFT"
VALIGN="TOP"
>The width to scale the image to. </TD
></TR
><TR
><TD
WIDTH="25%"
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="nxstruct_GR_SIZE.html"
><SPAN
CLASS="TYPE"
>GR_SIZE</SPAN
></A
></TD
><TD
WIDTH="25%"
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>height</I
></TT
></TD
><TD
WIDTH="50%"
ALIGN="LEFT"
VALIGN="TOP"
>The height to scale the image to. </TD
></TR
><TR
><TD
WIDTH="25%"
ALIGN="LEFT"
VALIGN="TOP"
><SPAN
CLASS="TYPE"
>char*</SPAN
></TD
><TD
WIDTH="25%"
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>path</I
></TT
></TD
><TD
WIDTH="50%"
ALIGN="LEFT"
VALIGN="TOP"
>A string containing the filename of the file to
            load. </TD
></TR
><TR
><TD
WIDTH="25%"
ALIGN="LEFT"
VALIGN="TOP"
><SPAN
CLASS="TYPE"
>int</SPAN
></TD
><TD
WIDTH="25%"
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>flags</I
></TT
></TD
><TD
WIDTH="50%"
ALIGN="LEFT"
VALIGN="TOP"
>Flags based of the specific image type. Currenly
        <TT
CLASS="PARAMETER"
><I
>flags</I
></TT
> is only used for loading JPEG
        files. If set to <TT
CLASS="CONSTANT"
>TRUE</TT
> the JPEG will be
        loaded in "fast grayscale" mode. If set to
        <TT
CLASS="CONSTANT"
>FALSE</TT
> the image will be drawn in RGB
        color mode. </TD
></TR
></TBODY
></TABLE
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2235"
></A
><H2
>See Also</H2
><P
>      <A
HREF="nxapi_GrFreeImage.html"
>            <TT
CLASS="FUNCTION"
>GrFreeImage()</TT
></A
>,
      <A
HREF="nxapi_GrGetImageInfo.html"
>            <TT
CLASS="FUNCTION"
>GrGetImageInfo()</TT
></A
>,
      <A
HREF="nxapi_GrLoadImageFromFile.html"
>            <TT
CLASS="FUNCTION"
>GrLoadImageFromFile()</TT
></A
>,
      <A
HREF="nxapi_GrDrawImageToFit.html"
>            <TT
CLASS="FUNCTION"
>GrDrawImageToFit()</TT
></A
>.
    </P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="nxapi_GrDrawImageBits.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="nxapi_GrDrawImageToFit.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><TT
CLASS="FUNCTION"
>GrDrawImageBits()</TT
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ch2.html"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><TT
CLASS="FUNCTION"
>GrDrawImageToFit()</TT
></TD
></TR
></TABLE
></DIV
></BODY
></HTML
>